package com.example.imtoken.core.utils

import androidx.navigation.NavOptions
import com.example.imtoken.R

object NavOptionsUtils {
    /**
     * 设置fragment左右切换动画
     * @return NavOptions
     */
    fun navOptions(): NavOptions {
        return NavOptions.Builder()
            .setEnterAnim(R.anim.slide_from_right)
            .setExitAnim(R.anim.slide_to_left)
            .setPopEnterAnim(R.anim.slide_from_left)
            .setPopExitAnim(R.anim.slide_to_right)
            .build()
    }

    /**
     * 设置fragment上下切换动画
     * @return NavOptions
     */
    fun navOptionsFromBottom(): NavOptions {
        return NavOptions.Builder()
            .setEnterAnim(R.anim.slide_from_bottom)
            .setExitAnim(R.anim.slide_to_top)
            .setPopEnterAnim(R.anim.slide_from_top)
            .setPopExitAnim(R.anim.slide_to_bottom)
            .build()
    }
}